<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>列表选择器 | MyUI 4.x</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/my/favicon.ico">
    <script>
      var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c4e5f73318b5cb0c389e3d9a05f831cc";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
    <meta name="description" content="MyUI是美亚柏科旗下新德汇出品的Web前端一站式项目工程框架，专注于公检法行业中台系统快速搭建，框架已在多个项目实战检验。">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    
    <link rel="preload" href="/my/assets/css/0.styles.9b3057af.css" as="style"><link rel="preload" href="/my/assets/js/app.91fb0046.js" as="script"><link rel="preload" href="/my/assets/js/597.873319f7.js" as="script"><link rel="preload" href="/my/assets/js/1838.528f79a3.js" as="script"><link rel="preload" href="/my/assets/js/1291.730865ea.js" as="script">
    <link rel="stylesheet" href="/my/assets/css/0.styles.9b3057af.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/my/" class="home-link router-link-active"><img src="/my/img/logo.png" alt="MyUI 4.x" class="logo"> <span class="site-name can-hide">MyUI 4.x</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/dv/" class="nav-link">
  大屏
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><a href="/my/ui/widgets/" class="nav-link router-link-active">
  补丁
</a></div><div class="nav-item"><a href="http://newgateway.gitee.io/my-web/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow down"></span></button> <button type="button" aria-label="JSDoc" class="mobile-dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/dv.html" class="nav-link">
  可视化大屏
</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/dv/" class="nav-link">
  大屏
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><a href="/my/ui/widgets/" class="nav-link router-link-active">
  补丁
</a></div><div class="nav-item"><a href="http://newgateway.gitee.io/my-web/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow down"></span></button> <button type="button" aria-label="JSDoc" class="mobile-dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/dv.html" class="nav-link">
  可视化大屏
</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><a href="/my/ui/widgets/dict.html" class="sidebar-link">dict 全局字典管理</a></li><li><a href="/my/ui/widgets/member-picker.html" class="sidebar-link">仿钉钉人员选择器</a></li><li><a href="/my/ui/widgets/org-member-picker.html" class="sidebar-link">部门人员关联选择器</a></li><li><a href="/my/ui/widgets/list-picker.html" aria-current="page" class="active sidebar-link">列表选择器</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#使用场景" class="sidebar-link">使用场景</a></li><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#安装命令" class="sidebar-link">安装命令</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#基础用法" class="sidebar-link">基础用法</a></li><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#自定义选项内容与查询条件" class="sidebar-link">自定义选项内容与查询条件</a></li><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#表格模式" class="sidebar-link">表格模式</a></li><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#结合表单" class="sidebar-link">结合表单</a></li><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#直接使用内部" class="sidebar-link">直接使用内部</a></li></ul></li><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#属性参数" class="sidebar-link">属性参数</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#表单弹窗参数" class="sidebar-link">表单弹窗参数</a></li><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#表单弹窗参数-2" class="sidebar-link">表单弹窗参数</a></li><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#其他参数" class="sidebar-link">其他参数</a></li></ul></li><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#api-method" class="sidebar-link">API method</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#picker-整体组件-方法" class="sidebar-link">Picker (整体组件)方法</a></li><li class="sidebar-sub-header"><a href="/my/ui/widgets/list-picker.html#pickercore-选择器组件-方法" class="sidebar-link">PickerCore (选择器组件) 方法</a></li></ul></li></ul></li><li><a href="/my/ui/widgets/go-panel-node.html" class="sidebar-link">面板节点模板工具函数</a></li><li><a href="/my/ui/widgets/charts1.html" class="sidebar-link">图表类插件集合1</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="列表选择器"><a href="#列表选择器" class="header-anchor">#</a> 列表选择器</h1> <h2 id="使用场景"><a href="#使用场景" class="header-anchor">#</a> 使用场景</h2> <p>快速实现列表选择模块功能。 通常用于关联数据的相互绑定。</p> <h2 id="安装命令"><a href="#安装命令" class="header-anchor">#</a> 安装命令</h2> <div class="language-sh line-numbers-mode"><pre class="language-sh"><code><span class="token function">npm</span> run widgets list-picker
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>执行命令后，工具生成在项目的 <strong><code>&quot;.my/widgets/list-picker&quot;</code></strong> 路径下；</p> <blockquote><p>生成文件目录如下：</p> <ul><li><strong><code>core.vue</code></strong> （选择器组件）</li> <li><strong><code>index.vue</code></strong> （选择器+表单+弹窗组件）</li></ul></blockquote> <h3 id="基础用法"><a href="#基础用法" class="header-anchor">#</a> 基础用法</h3> <p>常规使用组件</p> <!----><h3 id="自定义选项内容与查询条件"><a href="#自定义选项内容与查询条件" class="header-anchor">#</a> 自定义选项内容与查询条件</h3> <!----><h3 id="表格模式"><a href="#表格模式" class="header-anchor">#</a> 表格模式</h3> <!----><h3 id="结合表单"><a href="#结合表单" class="header-anchor">#</a> 结合表单</h3> <!----><h3 id="直接使用内部"><a href="#直接使用内部" class="header-anchor">#</a> 直接使用内部</h3> <p>使用选择器内部</p> <!----><h2 id="属性参数"><a href="#属性参数" class="header-anchor">#</a> 属性参数</h2> <p>组件基于my-select-field组件和my-list组件封装，</p> <h3 id="表单弹窗参数"><a href="#表单弹窗参数" class="header-anchor">#</a> 表单弹窗参数</h3> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>value</td> <td>用作v-model双向绑定</td> <td>array</td> <td>—</td> <td>[]</td></tr> <tr><td>fieldProps</td> <td>my-select-field组件的参数</td> <td>object</td> <td>-</td> <td>-</td></tr> <tr><td>optionsPropsMap</td> <td>选项表单与选项列表的共同字段映射</td> <td>object</td> <td>-</td> <td>{ label: 'name', id: 'id', value: 'id' }</td></tr> <tr><td>keepPickerState</td> <td>打开选择器时是否回填当前选择数据</td> <td>boolean</td> <td>-</td> <td>true</td></tr></tbody></table> <h3 id="表单弹窗参数-2"><a href="#表单弹窗参数-2" class="header-anchor">#</a> 表单弹窗参数</h3> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>listLoad</td> <td></td> <td>Function</td> <td></td> <td></td></tr> <tr><td>optionsPropsMap</td> <td>选项的字段映射</td> <td>Object</td> <td>-</td> <td>{ label: 'name', id: 'id', value: 'id' }</td></tr> <tr><td>selItemShowMax</td> <td>选中最多显示的数量</td> <td>Number</td> <td>-</td> <td>5</td></tr> <tr><td>isShowResult</td> <td>是否显示选中结果</td> <td>Boolean</td> <td>-</td> <td>true</td></tr> <tr><td>isShowSubmit</td> <td>是否显示提交按钮</td> <td>Boolean</td> <td>-</td> <td>true</td></tr> <tr><td>isMultiSel</td> <td>是否多选</td> <td>Boolean</td> <td>-</td> <td>true</td></tr></tbody></table> <h3 id="其他参数"><a href="#其他参数" class="header-anchor">#</a> 其他参数</h3> <p>支持 my-table 除 loader 外其他参数</p> <h2 id="api-method"><a href="#api-method" class="header-anchor">#</a> API method</h2> <h3 id="picker-整体组件-方法"><a href="#picker-整体组件-方法" class="header-anchor">#</a> Picker (整体组件)方法</h3> <table><thead><tr><th>参数</th> <th>说明</th> <th>参数</th> <th>输出</th></tr></thead> <tbody><tr><td>openPicker</td> <td>打开弹窗（dialog）的函数</td> <td>-</td> <td>-</td></tr> <tr><td>closePicker</td> <td>关闭弹窗（dialog）的函数</td> <td>-</td> <td>-</td></tr> <tr><td>filterSubmitHandle</td> <td>查询表单的提交函数</td> <td>query 表单查询数据</td> <td>-</td></tr></tbody></table> <h3 id="pickercore-选择器组件-方法"><a href="#pickercore-选择器组件-方法" class="header-anchor">#</a> PickerCore (选择器组件) 方法</h3> <table><thead><tr><th>参数</th> <th>说明</th> <th>参数</th> <th>输出</th></tr></thead> <tbody><tr><td>removeItemSel</td> <td>删除选中的选项</td> <td>item选项数据</td> <td>-</td></tr> <tr><td>getSelectItems</td> <td>获取选中的选项</td> <td>-</td> <td>选中数据数组</td></tr> <tr><td>setSelectItems</td> <td>设置选中的选项</td> <td>items 选项数据数组</td> <td>-</td></tr> <tr><td>clearSelectItems</td> <td>清空选中的选项</td> <td>-</td> <td>-</td></tr></tbody></table></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/my/ui/widgets/org-member-picker.html" class="prev">
        部门人员关联选择器
      </a></span> <span class="next"><a href="/my/ui/widgets/go-panel-node.html">
        面板节点模板工具函数
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/my/assets/js/app.91fb0046.js" defer></script><script src="/my/assets/js/597.873319f7.js" defer></script><script src="/my/assets/js/1838.528f79a3.js" defer></script><script src="/my/assets/js/1291.730865ea.js" defer></script>
  </body>
</html>
